package com.harry.ribbonconsumer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author Harry
 * @date 2018/3/28 14:12
 */
@RestController
public class ConsumerController {


    @Autowired
    RestTemplate restTemplate;

    @Autowired
    HelloService helloService;

    @RequestMapping(value = "ribbon-consumer",method = RequestMethod.GET)
    public String helloConsumer(){

        return helloService.hello();

//        return restTemplate.getForEntity("http://hello-server/hello",String.class).getBody();
    }
}
